<template>
  <div class="comment">
    <!-- <h2>评论</h2> -->
    <div class="write-cmt-box">
      <WriteCmt v-if="cmtChange"></WriteCmt>
    </div>
    <!-- 评论内容 -->
    <div class="cmt-content-box">
      <CmtContent @changeWrite="cmtSate"></CmtContent>
    </div>
  </div>
</template>

<script>
  import WriteCmt from './WriteCmt.vue';
  import CmtContent from './CmtContent.vue';
  export default {
    name: 'Comment',
    data() {
      return {
        cmtChange: true,
      };
    },
    props: ['essaysCom'],
    components: {
      CmtContent,
      WriteCmt,
    },
    methods: {
      cmtSate(change) {
        this.cmtChange = change;
      },
    },
    mounted() {
      console.log(this.essaysCom);
    },
  };
</script>

<style lang="less" scoped>
  .comment {
    width: 100%;
    h2 {
      width: 100%;
      height: 60px;
      text-align: center;
      line-height: 60px;
      color: #606266;
      cursor: pointer;
    }
  }
</style>
